package lab02.test33;

import java.text.Collator;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

/**
 * Created by Administrator on 2017/11/21.
 */
public class TreeListTest {
    public static void main(String[] args) {
        int i;
        List<String> list = new ArrayList<>();
        TreeListTest t = new TreeListTest();
        Scanner scanner = new Scanner(System.in);
        System.out.println("请确定要输入单词的数量");
        int a = scanner.nextInt();
        String word[] = new String[a];
        for (i = 0; i < a; i++) {
            System.out.println("请输入第" + (i + 1) + "个单词");
            list.add(word[i] = scanner.next());
        }
        Collections.sort(list, Collator.getInstance(java.util.Locale.CHINA));
        for (i = 0; i < list.size(); i++) {
            System.out.println(list.get(i));
        }
    }
}
